
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@page import="com.tss.util.*"%>
<%@page import="com.jedi.*"%>
<%@page import="com.store.*"%>
<%@page import="java.util.*"%>
<%@page import="java.text.*"%>
<%@include file="../global_var.jsp"%>
<%@include file="../check_login.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
User just_user = (User)session.getAttribute("LoginUser");
String power_enable_id = "10801";
if (!just_user.hasPower(power_enable_id)) {
	out.println(strNoPowerInfo); 
	return;
}

ArticleCateMgr cateMgr = new ArticleCateMgr();
List list = null;
%>
<html>
<head>
    <base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link href="style/main.css" rel="stylesheet" type="text/css">
<script language="javascript" src="js/common.js"></script>
<script language="javascript">
function clk_add_sub_cate(cate_id) {
	location.href = "know_article_cate_add.jsp?id=" + cate_id;
}

function clk_show_cate(cate_id) {
	location.href = "know_article_cate_show.jsp?id=" + cate_id;
}
</script>
</head>
<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td style="padding-left:25px;">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="31" valign="top" background="images/title_bk_01.gif" style="padding-left:10px;padding-top:6px;">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="50%" style="color:#FFFFFF;font-size:13px;">
                  <b>知识库</b> -&gt; 
                  <b>文章分类管理</b>
                </td>
                <td width="50%" align="right" style="padding-right:10px;">&nbsp;
                  <span onclick="right_menu_clk('know_article_cate_add.jsp');" style="cursor:hand;color:#FFFFFF;font-size:12px;text-de--ation: underline;">添加文章分类</span>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr> 
          <td height="100" align="right" valign="top" style="padding-top:12px;padding-bottom:10px;"> 
            <%
            String otherSQL = "";
            String orderField = "parent_id,is_leaf,order_id";
            list = cateMgr.get(otherSQL,orderField);
            if (list != null && list.size() > 0) {
            	for(int i=0;i<list.size();i++) {
            		ArticleCategory cateItem = (ArticleCategory)list.get(i);
            		if (!cateItem.isLeaf()) {
            %>
            <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
              <tr bgcolor="#858585"> 
                <td height="24" width="65%" style="padding-left:10px;color:#FFFFFF;"><b><%=cateItem.getCategoryName()%></b></td>
                <td width="15%" style="padding-left:4px;color:#FFFFFF;">
                  顺序：<%=cateItem.getOrderId()%>
                </td>
                <td width="20%" align="center">
                  <span style="text-decoration: underline;cursor:hand;color:#FFFFFF;" onclick="clk_add_sub_cate('<%=cateItem.getId()%>');">增加子分类</span> &nbsp; 
                  <span style="text-decoration: underline;cursor:hand;color:#FFFFFF;" onclick="clk_show_cate('<%=cateItem.getId()%>');">操作</span>
                </td>
              </tr>
            </table>
            <%		}else{%>
            <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
              <tr bgcolor="#EDEDF0"> 
                <td height="24" width="65%" style="padding-left:10px;"><b><%=cateItem.getCategoryName()%></b></td>
                <td width="15%" style="padding-left:4px;">
                  顺序：<%=cateItem.getOrderId()%>
                </td>
                <td width="20%" align="center">
                  <span style="text-decoration: underline;cursor:hand;" onclick="clk_show_cate('<%=cateItem.getId()%>');">操作</span>
                </td>
              </tr>
            </table>
            <%		}%>
            <%	}%>
            <%}else{%>
            <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
              <tr> 
                <td height="60" align="center">目前没有任何分类信息!</td>
              </tr>
            </table>
            <%}%>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>